import { createRouter, createWebHistory } from 'vue-router';
import DefaultLayout from '@/layout/DefaultLayout.vue';
import Login from '@/views/Login.vue';
import Home from '@/views/Home.vue';
import About from '@/views/About.vue';
import LeafletDemo from '@/views/LeafletDemo.vue';
import CesiumDemo from '@/views/CesiumDemo.vue';
import ZgzDispatch from '@/views/ZgzDispatch.vue';

const routes = [
  { path: '/login', component: Login },
  {
    path: '/',
    component: DefaultLayout,
    redirect: '/home',
    children: [
      { path: 'home', component: Home },
      { path: 'about', component: About },
      { path: 'leaflet', component: LeafletDemo },
      { path: 'cesium', component: CesiumDemo },
      { path: 'zgz', component: ZgzDispatch },
    ]
  }
];

const router = createRouter({
  history: createWebHistory(),
  routes
});

export default router;
